<template>
  <div class="popup">
    <div class="box">
      <img
        src="//s3.pstatp.com/toutiao/xitu_juejin_web/img/normal.0447fe9.png"
        alt=""
      />
      <div class="top">
        <h1>手机登陆</h1>
        <span @click="$store.commit('IsShowFalse')">X</span>
      </div>
      <div class="phone"> 
        <span>+86</span>
        <input type="text" placeholder="请输入手机号" v-model="phone" />
      </div>
      <div class="code">
        <input type="password" placeholder="请输入密码" v-model="password" @keydown.enter="login"/>
      </div>
      <button @click="login">登陆</button>
      <p>其他登陆方式</p>
      <h6>
        <span>注册登陆即表示同意</span>
        <span>用户协议</span>
        <span>隐私政策</span>
      </h6>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      phone: "",
      password: "",
    };
  },
  methods: {
    login() {
      this.$store.dispatch('login',{
          phone: this.phone,
          password: this.password,
        })
      
    },
  },
};
</script>

<style scoped lang="scss">
.popup {
  width: 100%;
  height: 100vh;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.2);
  .box {
    width: 318px;
    height: 305px;
    background: #fff;
    margin: 130px auto;
    position: relative;
    padding: 25px;
    img {
      width: 120px;
      height: 95px;
      position: absolute;
      left: 33%;
      top: -75px;
    }
    .top {
      width: 100%;
      height: 40px;
      h1 {
        float: left;
        font-size: 16px;
        font-weight: bold;
        color: #000;
      }
      span {
        float: right;
        font-size: 16px;
        font-weight: bold;
      }
    }
    .phone {
      width: 100%;
      height: 36px;
      line-height: 36px;
      border: 1px solid #dddddd;
      span {
        padding: 0 40px 0 10px;
      }
    }
    .code {
      margin-top: 15px;
      margin-bottom: 20px;
      width: 100%;
      height: 36px;
      line-height: 36px;
      border: 1px solid #dddddd;
      span {
        float: right;
        padding: 0 10px 0 0;
        color: #2994ff;
      }
    }
    button {
      width: 100%;
      height: 36px;
      line-height: 36px;
      text-align: center;
      border: 1px solid #dddddd;
      background: #2994ff;
      color: #fff;
    }
    p {
      margin: 20px 0;
      color: #2994ff;
    }
    h6 {
      span {
        padding-right: 15px;
      }
      span:nth-child(2) {
        color: #2994ff;
      }
      span:nth-child(3) {
        color: #2994ff;
      }
    }
  }
}
</style>
